import React, { Component } from 'react'
import { Table } from 'antd'
import { keyList } from './mock'
export default class componentName extends Component {
  columns = () => {
    return [
      {
        title: '姓名',
        dataIndex: 'name',
        key: 'name',
      },
      {
        title: '年龄',
        dataIndex: 'age',
        key: 'age',
      },
      {
        title: '住址',
        dataIndex: 'address',
        key: 'address',
      },
      {
        title: '操作',
        render: (v, r, i) => {
          return (
            <a
              onClick={() => {
                const { changeActiveKey } = this.props
                changeActiveKey && changeActiveKey('k2', v.name)
              }}
            >
              查看value
            </a>
          )
        },
      },
    ]
  }
  render() {
    return (
      <div>
        <h2>Key值</h2>
        <Table dataSource={keyList} columns={this.columns()} />
      </div>
    )
  }
}
